package com.jdk.learn.jvm;

public class _009MehtodInvoke {

    public void  sayHello(Child1 c){
        System.out.println("c1:"+c.getClass());
    }
    public void  sayHello(Child2 c){
        System.out.println("c2:"+c.getClass());
    }
    public void  sayHello(Parent c){
        System.out.println("parent:"+c.getClass());
    }

    public static void main(String[] args) {
        Parent c1 = new Child1();
        Parent c2 = new Child2();
        _009MehtodInvoke mehtodInvoke = new _009MehtodInvoke();
        mehtodInvoke.sayHello(c1);
        mehtodInvoke.sayHello(c2);
    }
}
    class Parent {
    }

    class Child1 extends Parent {
    }
    class Child2 extends Parent {
    }